import win32con
import win32clipboard as WC
from selenium import webdriver
from selenium.webdriver.common.by import By


class ClipBoard(object):
        @staticmethod
        def getText():
            WC.OpenClipboard()
            value = WC.GetClipboardData(win32con.CF_TEXT)
            WC.CloseClipboard()
            return value

        @staticmethod
        def setText(value):
            WC.OpenClipboard()
            WC.EmptyClipboard()
            WC.SetClipboardData(win32con.CF_UNICODETEXT, value)
            WC.CloseClipboard()

if __name__ == '__main__':
        value = 'python'
        driver = webdriver.Edge()
        driver.get('https://www.baidu.com/')
        query = driver.find_element(By.ID, 'kw')
        ClipBoard.setText(value)
        clValue = ClipBoard.getText()
        query.send_keys(clValue.decode('utf-8'))